package com.cfushn.ddd.catchlog.test;

import com.cfushn.ddd.application.dto.CodeEnum;
import com.cfushn.ddd.catchlog.ErrorResponseHandlerI;
import org.springframework.stereotype.Component;

@Component
public class CustomErrorResponseHandler implements ErrorResponseHandlerI {

    @Override
    public Object handle(Class<?> returnType, String errCode, String errMsg) {
        System.out.println("==== This is Customized Response handler");
        Demo.DemoResponse response = new Demo.DemoResponse();
        response.setCode(CodeEnum.ERROR.getCode());
        return response;
    }
}
